package richrail.view;

import java.util.Observable;
import java.util.Observer;

import javax.swing.JPanel;

import richrail.domain.Garage;

public abstract class AbstractGarageDisplay extends JPanel implements Observer {
	
	private static final long serialVersionUID = 1L;

	public AbstractGarageDisplay(Garage garage){
		garage.addObserver(this);
	}
	
	public void update(Observable o, Object arg) {
		if(o instanceof Garage) {
			this.update((Garage) o);
		}
		this.repaint();
	}
	
	public abstract void update(Garage garage);
}
